package com.baidu.controller;

import com.baidu.entity.Auth;
import com.baidu.entity.UserInfo;
import com.baidu.response.Response;
import com.baidu.service.AuthService;
import com.baidu.service.UserInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserInfoService userInfoService;
    @Autowired
    private AuthService authService;

    //查询所有，测试项目启动成功
    @RequestMapping("/selectAll")
    public List<UserInfo> selectAll() {
        return userInfoService.selectAll();
    }

    @RequestMapping("/auth-list")
    public Response<List<Auth>> authList(String userCode) {
        return authService.selectAuthByUserCode(userCode);
    }

}
